package com.sree.tali.actions;

import com.sree.tali.buscomp.DisplayBusComp;
import com.sree.tali.buscomp.DisplayBusCompImpl;
import com.sree.tali.plugin.HibernatePlugin;
import com.sree.tali.pojo.AdminHomepojo;
import java.io.PrintStream;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.actions.DispatchAction;
import org.hibernate.SessionFactory;

public class LoginAction
  extends DispatchAction
{
  public ActionForward displayHome(ActionMapping paramActionMapping, ActionForm paramActionForm, HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
    throws Exception
  {
    DisplayBusCompImpl localDisplayBusCompImpl = new DisplayBusCompImpl();
    SessionFactory localSessionFactory = (SessionFactory)this.servlet.getServletContext().getAttribute(HibernatePlugin.KEY_NAME);
    localDisplayBusCompImpl.DisplayHome(localSessionFactory.openSession(), paramHttpServletRequest);
    return paramActionMapping.findForward("homepage");
  }
  
  public ActionForward displayPage(ActionMapping paramActionMapping, ActionForm paramActionForm, HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
    throws Exception
  {
    String str = paramHttpServletRequest.getParameter("id");
    int i = 0;
    if (str != null) {
      i = Integer.parseInt(str);
    }
    System.out.println(str);
    DisplayBusCompImpl localDisplayBusCompImpl = new DisplayBusCompImpl();
    SessionFactory localSessionFactory = (SessionFactory)this.servlet.getServletContext().getAttribute(HibernatePlugin.KEY_NAME);
    AdminHomepojo localAdminHomepojo = localDisplayBusCompImpl.DisplayPage(localSessionFactory.openSession(), i);
    paramHttpServletRequest.setAttribute("commonpojo", localAdminHomepojo);
    localDisplayBusCompImpl.DisplayMostViewedPages(localSessionFactory.openSession(), paramHttpServletRequest);
    return paramActionMapping.findForward("commonpage");
  }
 
}



/* Location:           D:\sreenu\talivud-new-110514\talivud-new\dist\WEB-INF\classes\

 * Qualified Name:     com.sree.tali.actions.LoginAction

 * JD-Core Version:    0.7.0.1

 */